home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Development Kits / MPW etc / MPW-GM / Interfaces&Libraries / Interfaces / CIncludes / signal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-17  |  1.5 KB  |  70 lines  |  [TEXT/MPS ]

  1. /*
  2.     Signal.h -- Signal handling
  3.     
  4.     Copyright Apple Computer,Inc.    1988, 1990, 1995
  5.     All rights reserved.
  6.  
  7. */
  8.  
  9. #ifndef __SIGNAL__
  10. #define __SIGNAL__
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16. typedef int sig_atomic_t;
  17.  
  18. typedef void ( *__sigfun )( int __sig );
  19.  
  20. /*
  21.  *    Special signal handlers, compatible with the second argument to signal()
  22.  *    or, in the case of SIG_ERR, the return value from signal().
  23.  */
  24.  
  25. #define SIG_DFL (( __sigfun ) 1)
  26. #define SIG_ERR (( __sigfun ) -1)
  27. #define SIG_IGN (( __sigfun ) 0)
  28. #define SIG_HOLD (( __sigfun ) 3)
  29. #define SIG_RELEASE (( __sigfun ) 5)
  30.  
  31.  
  32. /*
  33.  *    Signal numbers for specific conditions.
  34.  */
  35.  
  36. #define SIGABRT        (1<<0)    /* Abnormal termination e.g. by the abort() function */
  37. #define SIGFPE        (1<<2)    /* Arithmetic exception -- not currently implemented */
  38. #define SIGILL        (1<<3)    /* Illegal instruction -- not currently implemented */
  39. #define SIGINT        (1<<1)    /* Interactive attention signal -- User interrupt via CMD-. */
  40. #define SIGSEGV        (1<<4)    /* Segmentation violation -- not currently implemented */
  41. #define SIGTERM        (1<<5)    /* Termination request -- not currently implemented */
  42.  
  43.  
  44. #if defined (__powerc) || defined (powerc) || defined (__CFM68K__)
  45.     #pragma import on
  46. #endif
  47.  
  48. /*
  49.  *    Specify a signal handling function.
  50.  */
  51.  
  52. extern __sigfun signal(int sig, __sigfun func);
  53.  
  54.  
  55. /*
  56.  *    Send a signal.
  57.  */
  58.  
  59. extern int raise (int sig);
  60.  
  61. #if defined (__powerc) || defined (powerc) || defined (__CFM68K__)
  62.     #pragma import off
  63. #endif
  64.  
  65. #ifdef __cplusplus
  66. }
  67. #endif
  68.  
  69. #endif
  70.